#!/usr/bin/env python
__author__ = "Ingmar Krusch"
__email__ = "krusch@immobilienscout24.de"
import sys, Dependency, Config
from Input import Input
from Dependency import Dependency
from Config import Config 

def main():
	config = Config()
	config.readCommandLineArguments(sys.argv[1:]) #skip the script name
	#print "debug config=",  config

	input = Input()
	input.optionallyHandleStdin(config.remainingArgs)
	#print "debug input=", input

	dep = Dependency(config.collapseDuplicates, config.filterRegex, config.positiveFilter)
	dep.add(input.rawDependencies)

	print dep

if __name__ == '__main__':
	main()
